package extreme.fizzbuzz;

public enum FbwEnum {
    THREE("Fizz", 3),
    FIVE("Buzz", 5),
    SEVEN("Whizz", 7);

    private String name;

    private int value;

    FbwEnum(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public int getValue() {
        return this.value;
    }

    public String getName() {
        return this.name;
    }

    public static String valueToName(int value) {
        for (FbwEnum ele : values()) {
            if (ele.getValue() == value) return ele.getName();
        }
        return null;
    }
}
